package org.apache.flink.endpoint;

import org.apache.flink.gateway.ResourceManagerGateway;
import org.apache.flink.runtime.rpc.RpcEndpoint;
import org.apache.flink.runtime.rpc.RpcService;

public class ResourceManagerRpcEndpoint extends RpcEndpoint implements ResourceManagerGateway {

    public ResourceManagerRpcEndpoint(RpcService rpcService, String endpointId) {
        super(rpcService, endpointId);
    }

    @Override
    protected void onStart() throws Exception {
        System.out.println("ResourceManagerRpcEndpoint onStart");
        System.out.println("   address:" + getAddress() + "  hostname:" + getHostname() );

    }

    @Override
    public void registerFromJobmanager(String jobManagerAddress) {
        System.out.println("ResourceManagerRpcEndpoint registerFromJobmanager:" + jobManagerAddress);

    }

    @Override
    public void registerFromTaskExecutor(String taskExecutorAddress) {
        System.out.println("ResourceManagerRpcEndpoint registerFromTaskExecutor:" + taskExecutorAddress);
    }


    @Override
    public void heatBeatFromTaskExecutor(String taskExecutorAddress) {
        System.out.println("ResourceManagerRpcEndpoint heatBeatFromTaskExecutor:" + taskExecutorAddress);
    }

    @Override
    public void heatBeatFromJobmanager(String jobManagerAddress) {
        System.out.println("ResourceManagerRpcEndpoint heatBeatFromJobmanager:" + jobManagerAddress);

    }
}
